package com.dimples.dd.system.convert;

import com.dimples.dd.common.pojo.PageResult;
import com.dimples.dd.system.api.logger.dto.OperateLogCreateReqDTO;
import com.dimples.dd.system.model.bo.SystemOperateLogBO;
import com.dimples.dd.system.model.entity.SystemOperateLogDO;
import com.dimples.dd.system.model.vo.OperateLogPageVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2024/9/6
 */
@Mapper(componentModel = "spring")
public interface OperateLogConvert {

    @Mappings({
            @Mapping(target = "beginTime", source = "beginTime", ignore = true),
            @Mapping(target = "endTime", source = "endTime", ignore = true)
    })
    SystemOperateLogDO vo2Entity(OperateLogCreateReqDTO operateLogCreateReqDTO);

    OperateLogPageVO entity2VO(SystemOperateLogDO systemOperateLogDO);

    PageResult<OperateLogPageVO> page2VO(PageResult<SystemOperateLogDO> pageResult);

    OperateLogPageVO bo2vo(SystemOperateLogBO systemOperateLogBO);

    PageResult<OperateLogPageVO> boPage2VO(PageResult<SystemOperateLogBO> pageResult);
}
